﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE


typedef struct ArcInfo {
   double startAngle;   /// 起始角 单位°
   double spanAngle;    /// 夹角   单位°
   QRectF rectangle;    /// 外接矩阵
}ArcInfo;


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
private:
    virtual void paintEvent(QPaintEvent *event)override;
    ArcInfo DrawArc(QPointF start, QPointF end, QPointF center, bool isAcw);
    QPointF ArcTransForm(QPointF start, QPointF end, QPointF center, bool isAcw);

private slots:
    void on_pushButton_clicked();

private:
    Ui::MainWindow *ui;
};


//自定义复数类
class ComplexNum
{
public:
    ComplexNum();
    ComplexNum(double a,double b);

public:
    //复数的四则运算
    ComplexNum operator +(const ComplexNum& num);
    ComplexNum operator -(const ComplexNum& num);
    ComplexNum operator *(const ComplexNum& num);
    ComplexNum operator /(const ComplexNum& num);

    //其他函数,设置和取模
    void setComplexNumValue(double a,double b);
    double getComplexNumMold();
    double A();
    double B();

private:
    double a,b;
};

#endif // MAINWINDOW_H
